<?php
defined('IN_TS') or die('Access Denied.');

class home extends tsApp{

	//鏋勯�鍑芥暟
	public function __construct($db){
		parent::__construct($db);
	}

	function crtable($table,$arr,$dis){
		foreach ($arr as $k=>$v){
			$arrs[]=$k.' '.$v;
		}
		$str=implode(',', $arrs);
		$sql="create table $table ($str) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci";
		mysql_query($sql);
	}

	public function adminlog($uid,$enm,$rnm,$cid,$content,$isop=0){
		$data=array(
				'uid'=>$uid,
				'ename'=>$enm,
				'content'=>$content,
				'isop'=>$isop,
				'addtime'=>time(),
				'realname'=>$rnm,
				'cid'=>$cid,
				'dtime'=>strtotime(date('Y-m-d'))
		);
		$id=$this->create('syslog', $data);
		return $id;
	}


}
